Skip to main content

All Questions

2votes
2answers
135views

LinkedList Stack Implementation

I'm new to the programming and I want to ask a question about my linkedlist stack implementation if it's correct and if it meets the requirements of the linkedlist stack implementation. If there is ...
E.Etem's user avatar
0votes
2answers
71views

Another Stack implementation in Java

I'm trying to write my own stack implementation using LinkedList. It looks like it is doing what it should doing. But how does it look from a design perspective? ...
Paweł Jarosiewicz's user avatar
3votes
1answer
759views

Detecting a cycle in a linked list using Java

I'm solving HackerRank "Linked Lists: Detect a Cycle" challenge. A linked list is said to contain a cycle if any node is visited more than once while traversing the list. Complete the ...
justapilgrim's user avatar
4votes
3answers
372views

Linked list node implementation with maximum code reuse

Currently as an exercise to practicing SOLID principles and basic data structures, I am trying to implement linked list type structures with as much code reuse as possible. Currently, I have: ...
Matthew Wahner's user avatar
4votes
2answers
2kviews

LinkedList implementation with Iterators in Java

I am a newbie to Java. I will be glad to hear your opinion with regards to this LinkedList implementation. The Iterators are self implemented by my decision: ...
Arigatonic's user avatar
1vote
3answers
823views

Doubly linked list in Java

I did not add generics to my code because I am new to Java. I am on my way in learning data structures and algorithms. I just want to make sure that my code is clean and efficient. ...
Gs niteesh's user avatar
2votes
1answer
140views

Partition a singly linked list using Java - follow-up

This is a follow up to my last question: Partition a singly linked list using Java Based on the feedback I received there, I changed the following about the code: Added a ...
Average's user avatar
2votes
2answers
1kviews

Partition a singly linked list using Java

This is my attempted solution to exercise 2.4 in Cracking the Coding Interview. The problem statement is: Write code to partition a linked list around a value x such that all nodes less than x come ...
Average's user avatar
2votes
1answer
658views

Implementation of Queue using Linkedlist in Java

Can someone please review my code? Is it the correct implementation of a queue? If not, please give suggestions on how to implement it using a linked list. ...
nik7's user avatar
4votes
1answer
75views

How can I enhance my linkedlist implementation in java?

I recently implemented Linked List on my own. I did not use generics as I am still learning. How can I improve it: ...
Gs niteesh's user avatar
0votes
1answer
1kviews

Using composition or inheritance to enhance this linked list

Problem Statement: A method called insertEnd() exists, but it runs in linear time, because every time it is called, it walks down the list to find the end. Without changing the meaning of this ...
overexchange's user avatar
2votes
1answer
191views

Self-made linked list implementing List<E>

I have to make a linked list as a quasi-homework task, about which I have already asked two questions about here and here. Since the whole code is really big (400 lines approx.), I will include only ...
Attila Herbert's user avatar
5votes
3answers
7kviews

Custom linked list implementing Iterable used as stack

I have created a custom linked list that implements the Iterable interface. I am then using this linked list to implement my custom stack. I have also thrown a ...
Ishan Soni's user avatar
13votes
2answers
30kviews

Self-made linked list iterator

I recently made a linked list for myself, the code of which was posted here, if anyone would be interested. Now, as the next task, I had to make an Iterator for my ...
Attila Herbert's user avatar
18votes
5answers
5kviews

Self-made Linked List

I was tasked by my teacher with making a linked list by myself, so I could understand the concept better. Here is the MyLinkedList class: ...
Attila Herbert's user avatar

153050per page
close